package com.tensquare.gathering.controller;

import com.tensquare.gathering.config.Log;
import com.tensquare.gathering.service.ISysLogService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * @author Promise
 * @createTime 2019年1月2日 下午10:35:30
 * @description 测试controller
 */
@Controller
public class HomeController {

    private final static Logger log = LoggerFactory.getLogger(HomeController.class);

    @Autowired
    private ISysLogService logService;

    @RequestMapping("/aop")
    @ResponseBody
    @Log("测试aoplog")
    public Object aop(String name, String nick) {
        Map<String, Object> map = new HashMap<>();
        log.info("我被执行了！");
        map.put("res", "ok");
        return map;
    }

    @RequestMapping("/aop2")
    @ResponseBody
    @Log("测试aoplog2")
    public Object aop2(String name, String nick) {
        Map<String, Object> map = new HashMap<>();
        log.info("哈哈哈！");
        map.put("啊啊啊", "ok");
        return map;
    }
}
